<?php defined( '_JEXEC') or die( 'Restricted access'); // No direct access ?>
    <div class="subhead">
        <fieldset>
            <legend>
                <h3 class="heading">Add new industry:</h3>
            </legend>
            <p>
				<form name="form1" id="form1" method="post" action="<?php echo JRoute::_('index.php?option=com_volunteer&task=addindustry') ;?>">
					New industry:
					<input type="text" name="newindustry" value="<?php echo $this->newindustry;?>" />
					<input type="submit" value="Add" />
				</form>
            </p>
        </fieldset>
		<fieldset>
            <legend>
                <h3>Search existing industry:</h3>
            </legend>
            <p>
				<form name="form2" id="form2" method="post" action="<?php echo JRoute::_('index.php?option=com_volunteer&task=searchindustry') ;?>">
					Name:
					<input type="text" name="searchindustry" value="<?php echo $this->searchindustry;?>" />
					<input type="submit" value="Search" />
				</form>
            </p>
        </fieldset>
        <p>
            <b>
<?php if($this->searchindustry): ?>
			<h2>Search results: <?php echo sizeof($this->results); ?> industry(es) found</h2>
<?php else: ?>
			<h2>All industries:</h2>
<?php endif; ?>
            </b>
        </p>
        <table border="1" cellspacing="0" width="100%">
            <tr bgcolor="#6cb33f" align="center">
                <td width="20%">
                    <strong>
                        Industry
                    </strong>
                </td>
                <td width="55%">
                    <p>
                        <strong>
                            Files associated
                        </strong>
                    </p>
                </td>
                <td width="25%">
                    <strong>Action</strong>
                </td>
            </tr>
<?php foreach($this->results as $industry): ?>
            <tr>
                <td>
                    <a href="<?php echo JRoute::_('index.php?option=com_volunteer&view=searchfile&industry=' . $industry->id . '&timespan=-1&industry=-1&keywords='); ?>"><?php echo $industry->industry ?></a>
                </td>
                <td>
                    <p>
                        <a href="<?php echo JRoute::_('index.php?option=com_volunteer&view=searchfile&industry=' . $industry->id . '&timespan=-1&location=-1&keywords='); ?>">View files associated with "<?php echo $industry->industry ?>"</a>
                    </p>
                </td>
                <td align="center">
                     <a href="<?php echo JRoute::_('index.php?option=com_volunteer&view=searchfile&industry=' . $industry->id . '&timespan=-1&location=-1&keyword='); ?>">View</a>
                    &nbsp;
                    <a href="<?php echo JRoute::_('index.php?option=com_volunteer&view=editindustry&industry=' . $industry->id); ?>">Edit</a>
                    &nbsp;
                    <a href="<?php echo JRoute::_('index.php?option=com_volunteer&task=deleteindustry&industry=' . $industry->id); ?>" onclick="javascript:return confirm('Are you sure to delete this industry? All the files associated with it will also be deleted. This can not be undone.')">Delete</a>
                </td>
            </tr>
<?php endforeach; ?>            
        </table>
        <p>
            
        </p>
    </div>